<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
	<!-- <meta name="viewport" content="user-scalable=no,viewport-fit=cover" /> -->
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> 
	<link href="./css/baseCss.css" rel="stylesheet" type="text/css"/>
	<link href="./base/layer.css" rel="stylesheet" type="text/css"/>
	<!-- <link href="./base/articlecon.css" rel="stylesheet" type="text/css"/> -->
	<link href="./base/base2.css" rel="stylesheet" type="text/css"/>
	<script type="text/javascript" src="./base/rem.js"></script>
	<script type="text/javascript" src="./base/iscroll.js"></script>
	<style type="text/css">
		
        

        /*每一个地址的样式*/
        .address{
            margin-top: 0.05rem;
        }
        .address_every{
            background-color: #fff;
            padding: 0.5rem 0.5rem 0 0.5rem;
            position: relative;
        }
        .address_spe{
            margin-right: 0.3rem;
        }
        .address_det{
            font-size: 0.4rem;
        }
        .address_infor{
            color: #999999;
            margin-top: 0.3rem;
            border-bottom: 0.02rem solid #f4f4f4;
            padding-bottom: 0.5rem;
        }
        .address_editor img{
            width: 0.6rem;
            position: absolute;
            right: 0.5rem;
            top: 40%;
        }
        .address_tag{
            display: inline-block;
            border: 0.03rem solid;
            font-size: 0.3rem;
            border-radius: 0.1rem;
            vertical-align: top;
            margin-top: 0.05rem;
            width: 1rem;
            text-align: center;
        }
        .address_tag_home{
            border-color: #fe6e6e;
            color: #fe6e6e;
            background-color: #fad2d1;
        }
        .address_tag_company{
            border-color: #5cd1fe;
            color: #5cd1fe;
            background-color: #d8f0fa;
        }
        .address_tag_school{
            border-color: #00b900;
            color: #00b900;
            background-color: #d9f4d7;
        }

        /*中间图片*/
        section{
            padding: 0.33rem 0.5rem;
        }
        .imges{
            background-color: #fff;
            padding: 0.33rem;
            border-radius: 0.08rem;
        }
        .imges_title{
            border-bottom: 0.02rem solid #f5f5f5;
            padding-bottom: 0.4rem;
            margin-bottom: 0.4rem;
        }
        .imges_list{
            overflow: auto;
            margin-left: -0.4rem;
        }
        .imges_every{
            float: left;
            width: 45%;
            padding-top: 0.67rem;
            padding-bottom: 0.83rem;
            border: 0.02rem solid #f5f5f5;
            margin-left: 0.4rem;
        }
        .imges_every span{
            display: inline-block;
            height: 3.83rem;
            width: 100%;
            overflow: hidden;
        }
	</style>
	<title>营业资质</title>
</head>

<body>
	
    <div class="main">
        <header class="allHeader">
            <div class="headerReturn" onclick="window.history.back(-1);"><img class="imgBai" src="./img/nav_bake.png"></div>
            <span class="addOreditor">营业资质</span>
            <div class="headerList"><img class="imgBai" src="./img/nav_menu.png"></div>
        </header>
        <section>
            <div class="imges">
                <div class="imges_title">商家从业资质</div>
                <div>
                    <ul class="imges_list">
                        <!-- <li class="imges_every"><span><img class="imgBai" src="./img/res_01.png"></span></li>
                        <li class="imges_every"><span><img class="imgBai" src="./img/res_01.png"></span></li>
                        <li class="imges_every"><span><img class="imgBai" src="./img/res_01.png"></span></li>
                        <li class="imges_every"><span><img class="imgBai" src="./img/res_01.png"></span></li>
                        <li class="imges_every"><span><img class="imgBai" src="./img/res_01.png"></span></li> -->
                    </ul>
                </div>
            </div>
        </section>
    </div>
	
</body>
<script type="text/javascript" src="./js/jquery.min.js"></script>
<script type="text/javascript" src="./js/httpUnit.js"></script>
<script type="text/javascript" src="./js/constants.js"></script>
<!-- <script type="text/javascript" src="./js/address.js"></script> -->
<script type="text/javascript">
    findRestQualification();
    //餐厅资质列表
    function findRestQualification(){
        var Request = new Object();
        Request = GetRequest();
        var restaurantId = Request['id'];
        var page = 0;
        var size = 5;
        
        var sort = new Array();
        sort.push("id");

        var obj = JSON.stringify({
            "restaurantId": restaurantId,
        });
        httpHelperpost("/api/restQualifications/findRestQualification?page="+page+"&size="+size+"&sort="+sort, obj, function(isSuccess, data) {
            if (isSuccess == true) {
                var response = data.responseText;
                var value = JSON.parse(response);
                    
                // console.log(response);
                
                if(value.code == 0){
                    console.log("查询成功");
                    var html = "";
                    for(var i=0;i<value.data.content.length;i++){
                        html += "<li class='imges_every'><span><img class='imgBai' src="+value.data.content[i].image+"></span></li>"
                    }

                    $(".imges_list").html(html);
                }else if(value.code==401){
                    alert(value.message);
                    window.location.href='./index.html';
                }else{
                    alert(value.message);
                    console.log("查询失败");
                }
            }else {}
        });
    }

    //获取url中"?"符后的字串
    function GetRequest() {
        var url = location.search; //获取url中"?"符后的字串   
        
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
          var str = url.substr(1);
          
          strs = str.split("&");
          
          for (var i = 0; i < strs.length; i++) {
            
            theRequest[strs[i].split("=")[0]] = strs[i]
                .split("=")[1];
          }
        }
        return theRequest;
    }

    // ceshi();
    //测试
    function ceshi(){
               
        var userId = "1";
        var restaurantId = "1";
        var obj = JSON.stringify({
            "userId": userId,
            "restaurantId": restaurantId,
        });
        httpHelperpost("/api/restaurantCollects/addRestaurantCollect", obj, function(isSuccess, data) {
            if (isSuccess == true) {
                var response = data.responseText;
                var value = JSON.parse(response);
                    
                console.log(response);
                
                if(value.code == 0){
                    console.log("查询成功");
                    
                }else if(value.code==401){
                    alert(value.message);
                    window.location.href='./index.html';
                }else{
                    console.log("查询失败");
                }
            }else {}
        });
    }
</script>

</html>